#include <reg51.h>
sbit LED1 = P1^0;
sbit LED2 = P1^1;
sbit KEY1 =  P3^0;
sbit KEY2 =  P3^1;
sbit KEY3 =  P3^2;
void delay(unsigned int time) 
{
    unsigned int i, j;
    for (i = 0; i < time; i++)
        for (j = 0; j < 120; j++);
}
void main() 
{
    while (1) 
	{	if(KEY1 == 0)
	    {
           LED1 = 0;
		   LED2 = 1;
		   delay(500);
		}
        if(KEY2 == 0)
		{  
           LED1 = 1;
           LED2 = 0;
           delay(500);
		}
    
	    if (KEY3 == 0) 
		   {
               LED1 = 1; 
			   LED2 = 1; 
			   delay(500);
               LED1 = 0; 
			   LED2 = 0; 
			   delay(500);
           } 
               LED1 = 1;
               LED2 = 1;
			   delay(500);

    }
}  
   